#include "MainCameraControllerState.h"
#include "CameraManager.h"
using namespace Branch1::Camera;
MainCameraControllerState::MainCameraControllerState(){}
MainCameraControllerState::~MainCameraControllerState(){}
void MainCameraControllerState::stateStart()
{
	CameraManager::getInstance().setCamera(_camera);
	_tpshoulderCamera = new Branch1::Camera::TPShoulderCamera(_node/*,Vector3(-23,80,0),-120*/);
	_freeCamera = new Branch1::Camera::FreeCamera(_sceneMgr->getRootSceneNode()->createChildSceneNode()); 
	CameraManager::getInstance().initCameraType(_tpshoulderCamera);
	CameraManager::getInstance().initCameraType(_freeCamera);
	/*CameraManager::getInstance().SetCameraType("FreeCamera");*/
	CameraManager::getInstance().SetCameraType("TPShoulderCamera");
}
void MainCameraControllerState::stateEnd()
{
	_tpshoulderCamera = NULL;
}
void MainCameraControllerState::addTime(float interval)
{

	CameraManager::getInstance().AddTime(interval);

}
void MainCameraControllerState::injectKeyDown(const DAISY::KeyEvent & evt)
{
	CameraManager::getInstance().InjectKeyDown(evt);
}
void MainCameraControllerState::injectKeyUp(const DAISY::KeyEvent & evt)
{
	CameraManager::getInstance().InjectKeyUp(evt);
}
void MainCameraControllerState::injectMouseMove(const DAISY::MouseEvent & evt)
{
	CameraManager::getInstance().InjectMouseMove(evt);
}
void MainCameraControllerState::injectMouseUp(const DAISY::MouseEvent& evt, DAISY::MouseButtonID id)
{
	CameraManager::getInstance().InjectMouseUp(evt,id);
}
void MainCameraControllerState::injectMouseDown(const DAISY::MouseEvent& evt, DAISY::MouseButtonID id)
{
	CameraManager::getInstance().InjectMouseDown(evt,id);
}
